#ifndef OMG_DDS_DLL_HPP_
#define OMG_DDS_DLL_HPP_

/* Copyright (c) 2009-2010, Real-Time Innovations, Inc.
 * Copyright (c) 2010, Object Management Group, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 * - Neither the names of the above copyright holders nor the names of their
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL A COPYRIGHT HOLDER OR CONTRIBUTOR BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/* This NON-NORMATIVE header contains macros to allow implementations that
 * support deployment as a shared library to control which symbols are
 * exported from that shared library.
 */


// Generic helper definitions for shared library support
#if defined _WIN32 || defined __CYGWIN__
  // Building on Windows:
  #define OMG_DDS_HELPER_DLL_IMPORT __declspec(dllimport)
  #define OMG_DDS_HELPER_DLL_EXPORT __declspec(dllexport)
  #define OMG_DDS_HELPER_DLL_LOCAL
#else
  #if __GNUC__ >= 4
    // Building with GCC version 4 or above:
    #define OMG_DDS_HELPER_DLL_IMPORT __attribute__ ((visibility("default")))
    #define OMG_DDS_HELPER_DLL_EXPORT __attribute__ ((visibility("default")))
    #define OMG_DDS_HELPER_DLL_LOCAL  __attribute__ ((visibility("hidden")))
  #else
    // Building with another compiler:
    #define OMG_DDS_HELPER_DLL_IMPORT
    #define OMG_DDS_HELPER_DLL_EXPORT
    #define OMG_DDS_HELPER_DLL_LOCAL
  #endif
#endif

// Now we use the generic helper definitions above to define
// OMG_DDS_API and OMG_DDS_LOCAL.
// 	-> OMG_DDS_API is used for the public API symbols. It either
// 	   DLL imports or DLL exports (or does nothing for static
// 	   builds).
// 	-> OMG_DDS_LOCAL is used for non-API symbols.
#ifdef OMG_DDS_DLL // defined if DDS is compiled as a shared library
  #ifdef OMG_DDS_DLL_EXPORTS // defined if we are building DDS
                             // (instead of using it)
    #define OMG_DDS_API OMG_DDS_HELPER_DLL_EXPORT
  #else
    #define OMG_DDS_API OMG_DDS_HELPER_DLL_IMPORT
  #endif                // OMG_DDS_DLL_EXPORTS
  #define OMG_DDS_LOCAL OMG_DDS_HELPER_DLL_LOCAL
#else			// OMG_DDS_DLL is not defined: DDS is a static lib.
  #define OMG_DDS_API
  #define OMG_DDS_LOCAL
#endif  // define (OMG_DDS_DLL)

#endif  // !defined(OMG_DDS_DLL_HPP_)
